package 线程停止;
class mthreads extends Thread{
	private long i=0;
	public void run()
	{
		while(true)
		{
			i++;
			System.out.print("i="+i);
		}
	}
}
public class Test1_47 {

	public static void main(String[] args) {
		try {
			mthreads thread=new mthreads();
			thread.start();
			Thread.sleep(1000);
			thread.suspend();
			System.out.print("main end");//没有打印出"main end"原因是当程序运行到println()方法内部停止时，同步锁未被释放。这导致
			//当前PringStream对象的println()方法一直处于"暂停"状态，并且锁未被释放
			
			
		} 
		catch (InterruptedException e) {
			// TODO: handle exception
			e.printStackTrace();
		}
	}
	}